//
//  TestViewController.m
//  KMedicine
//
//  Created by 曹牧 on 16/7/7.
//  Copyright © 2016年 caomu. All rights reserved.
//

#import "TestViewController.h"
#import "AkuNetWorkTool.h"

//网络请求
@interface TestViewController ()

@end

@implementation TestViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self getDemo1];
  
}

- (void)getlogin{
    
        NSDictionary * dic = @{@"page":@1,@"page_size":@15,@"ci1_id":@2,@"keyword":@""};
    
        [AkuNetWorkTool POST_RequestWithURLString:@"http://iosapi.itcast.cn/searchCI3List.json.php" params:dic successBlock:^(id responseObject) {
    
//            NSString *str = 
            
            NSLog(@"%@", [responseObject class] );
            
            
//            NSLog(@"success");
//            NSLog(@"%@",responseObject);
    
        } errorBlock:^(NSError *error) {
            NSLog(@"error");
        }];
}

- (void)getDemo1{
    //2.疾病细分接口
    //    请求地址: http://iosapi.itcast.cn/searchCI3List.json.php
    //    请求参数:{"page":1,"page_size":15,"ci1_id":1,"keyword":""}
    
    /*
     肿瘤     ci1_id = 1
     心血管   ci1_id = 2
     神经科   ci1_id = 3
     血液科   ci1_id = 4
     骨科     ci1_id = 5
     公益活动 ci1_id = 6
     */
    
    NSDictionary * dic1 = @{@"page":@1,@"page_size":@15,@"ci1_id":@1,@"keyword":@""};
    [AkuNetWorkTool POST_RequestWithURLString:@"http://iosapi.itcast.cn/searchCI3List.json.php" params:dic1 successBlock:^(id responseObject) {
        
        NSArray * array = responseObject[@"data"];

        [array enumerateObjectsUsingBlock:^(NSDictionary *  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            NSString * str = obj[@"ci3_name"];
            NSLog(@"%@",str);
        }];
        
        
//        NSArray * array = responseObject[@"data"];
//        [array enumerateObjectsUsingBlock:^(NSDictionary *  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
////            NSString * str = obj[@"ci3_name"];
//            NSLog(@"%@",obj);
//        }];
        
    } errorBlock:^(NSError *error) {
        NSLog(@"error");
        
    }];
}



@end
